package com.sfh.cpc.com.req;

import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.text.TextUtils;

import com.sfh.cpc.com.entity.EUser;
import com.sfh.cpc.com.entity.RspBase;
import com.sfh.lib.mvvm.service.NetWorkState;

/***
 * 注册
 */
public class ReqUserRegister extends ReqBase<RspBase<EUser>>{
	String name;
	String pwd;
	String sex;
	String address;
	String url;

	public ReqUserRegister() {
		super("user/regiest");
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPwd() {
		return pwd;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	
	public  boolean checkParam(MutableLiveData liveData){
		if (TextUtils.isEmpty(url)){
			liveData.setValue(NetWorkState.showToast("请上传头像"));
			return true;
		}
		if (TextUtils.isEmpty(name)){
			liveData.setValue(NetWorkState.showToast("账号不能为空"));
			return true;
		}
		if (TextUtils.isEmpty(pwd)){
			liveData.setValue(NetWorkState.showToast("密码不能为空"));
			return true;
		}
		if (TextUtils.isEmpty(address)){
			liveData.setValue(NetWorkState.showToast("选择所在城市"));
			return true;
		}
		return false;
	}

}
